package com.fh.service.building;

import com.fh.dao.DaoSupport;
import com.fh.entity.Page;
import com.fh.util.PageData;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service("unitService")
public class UnitService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/*
	* 新增
	*/
	public void save(PageData pd)throws Exception{
		dao.save("UnitMapper.save", pd);
	}

	/*
	* 修改
	*/
	public void edit(PageData pd)throws Exception{
		dao.update("UnitMapper.edit", pd);
	}

	/*
	* 通过buildingId获取数据
	*/
	public List<PageData> findByBuildingId(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("UnitMapper.findByBuildingId", pd);
	}
	
}

